﻿<?xml version="1.0" encoding="utf-8" ?>
<Rules FriendlyName="Code Analysis Extensions Rules">
    <Rule 
        TypeName="UnitTestMustHaveDescription" 
        Category="CodeAnalysisExtensions.UnitTestRules" 
        CheckId="EX0001">
        
        <Name>Unit test must have a description</Name>
        <Description>In order to provide comment in code as well as to display test description in unit test engine reports, description must be provided for all unit tests.</Description>
        <Url>http://codeanalysisextension.codeplex.com</Url>
        <Resolution>Add [Description] attribute to '{0}' method.</Resolution>
        <Email />
        <MessageLevel Certainty="95">Warning</MessageLevel>
        <FixCategories>NonBreaking</FixCategories>
        <Owner>OWNER</Owner>
    </Rule>

    <Rule 
        TypeName="UnitTestShouldNotContainLoops" 
        Category="CodeAnalysisExtensions.UnitTestRules" 
        CheckId="EX0002">
        
        <Name>Unit test should not contain loops</Name>
        <Description>Unit test should not contain any loops (e.g. while, foreach, for), because that means they do not test only one thing.</Description>
        <Url>http://codeanalysisextension.codeplex.com</Url>
        <Resolution>Test only one thing per test or split test into multiple tests.</Resolution>
        <Email />
        <MessageLevel Certainty="95">Warning</MessageLevel>
        <FixCategories>NonBreaking,DependsOnFix</FixCategories>
        <Owner>OWNER</Owner>
    </Rule>

    <Rule
        TypeName="UnitTestShouldNotCallTest"
        Category="CodeAnalysisExtensions.UnitTestRules"
        CheckId="EX0003">

        <Name>Unit test should not call other unit tests</Name>
        <Description>Unit tests should not be mutually dependent and therefore should not call each other.</Description>
        <Url>http://codeanalysisextension.codeplex.com</Url>
        <Resolution>Remove call to '{0}' method from '{1}' method. If you want to reuse logic from another unit test, extract it into separate method.</Resolution>
        <Email />
        <MessageLevel Certainty="95">Warning</MessageLevel>
        <FixCategories>NonBreaking,DependsOnFix</FixCategories>
        <Owner>OWNER</Owner>
    </Rule>

    <Rule
        TypeName="UnitTestShouldNotContainIf"
        Category="CodeAnalysisExtensions.UnitTestRules"
        CheckId="EX0004">

        <Name>Unit test should not contain if statemens</Name>
        <Description></Description>
        <Url>http://codeanalysisextension.codeplex.com</Url>
        <Resolution></Resolution>
        <Email />
        <MessageLevel Certainty="95">Warning</MessageLevel>
        <FixCategories>NonBreaking,DependsOnFix</FixCategories>
        <Owner>OWNER</Owner>
    </Rule>
</Rules>